
import Header from '@/components/Header.vue' ;
import Navigator from '@/components/Navigator.vue' ;
import Main from '@/components/Main.vue' ;
import Footer from '@/components/Footer.vue' ;

import User from '@/components/User.vue' ;
import NotFound from '@/components/NotFound.vue' ;
import Book from '@/components/Book.vue' ;


const routes = [
    {
        path: '/' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: Main ,
            footer: Footer 
        }
    },
    {
        path: '/user' ,
        name: 'user' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: User ,
            footer: Footer 
        }
    },
    {
        path: '/:path(.*)*' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: NotFound ,
            footer: Footer 
        }
    },
    {
        path: '/book/:bookId(\\d+)' ,
        name: 'bookId' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: Book ,
            footer: Footer 
        },
        props: {
            header: false ,
            navigator: false,
            main: true ,
            footer: false 
        }
    },
    {
        path: '/book/:bookName(\\w+)' ,
        name: 'bookName' ,
        components: {
            header: Header ,
            navigator: Navigator,
            main: Book ,
            footer: Footer 
        },
        props: {
            header: false ,
            navigator: false,
            main: true ,
            footer: false 
        }
    }
]

export default routes ;